package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.AutoFill;
import com.ruoyi.common.enums.AutoFillType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DispatchEnergyConsumptionRecordsMapper;
import com.ruoyi.system.domain.DispatchEnergyConsumptionRecords;
import com.ruoyi.system.service.IDispatchEnergyConsumptionRecordsService;

/**
 * 能耗记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-02
 */
@Service
public class DispatchEnergyConsumptionRecordsServiceImpl implements IDispatchEnergyConsumptionRecordsService 
{
    @Autowired
    private DispatchEnergyConsumptionRecordsMapper dispatchEnergyConsumptionRecordsMapper;

    /**
     * 查询能耗记录
     * 
     * @param energyConsumptionRecordsId 能耗记录主键
     * @return 能耗记录
     */
    @Override
    public DispatchEnergyConsumptionRecords selectDispatchEnergyConsumptionRecordsByEnergyConsumptionRecordsId(Long energyConsumptionRecordsId)
    {
        return dispatchEnergyConsumptionRecordsMapper.selectDispatchEnergyConsumptionRecordsByEnergyConsumptionRecordsId(energyConsumptionRecordsId);
    }

    /**
     * 查询能耗记录列表
     * 
     * @param dispatchEnergyConsumptionRecords 能耗记录
     * @return 能耗记录
     */
    @Override
    public List<DispatchEnergyConsumptionRecords> selectDispatchEnergyConsumptionRecordsList(DispatchEnergyConsumptionRecords dispatchEnergyConsumptionRecords)
    {
        return dispatchEnergyConsumptionRecordsMapper.selectDispatchEnergyConsumptionRecordsList(dispatchEnergyConsumptionRecords);
    }

    /**
     * 新增能耗记录
     * 
     * @param dispatchEnergyConsumptionRecords 能耗记录
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.INSERT)
    @Override
    public int insertDispatchEnergyConsumptionRecords(DispatchEnergyConsumptionRecords dispatchEnergyConsumptionRecords)
    {return dispatchEnergyConsumptionRecordsMapper.insertDispatchEnergyConsumptionRecords(dispatchEnergyConsumptionRecords);
    }

    /**
     * 修改能耗记录
     * 
     * @param dispatchEnergyConsumptionRecords 能耗记录
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.UPDATE)
    @Override
    public int updateDispatchEnergyConsumptionRecords(DispatchEnergyConsumptionRecords dispatchEnergyConsumptionRecords)
    {
        return dispatchEnergyConsumptionRecordsMapper.updateDispatchEnergyConsumptionRecords(dispatchEnergyConsumptionRecords);
    }

    /**
     * 批量删除能耗记录
     * 
     * @param energyConsumptionRecordsIds 需要删除的能耗记录主键
     * @return 结果
     */
    @Override
    public int deleteDispatchEnergyConsumptionRecordsByEnergyConsumptionRecordsIds(Long[] energyConsumptionRecordsIds)
    {
        return dispatchEnergyConsumptionRecordsMapper.deleteDispatchEnergyConsumptionRecordsByEnergyConsumptionRecordsIds(energyConsumptionRecordsIds);
    }

    /**
     * 删除能耗记录信息
     * 
     * @param energyConsumptionRecordsId 能耗记录主键
     * @return 结果
     */
    @Override
    public int deleteDispatchEnergyConsumptionRecordsByEnergyConsumptionRecordsId(Long energyConsumptionRecordsId)
    {
        return dispatchEnergyConsumptionRecordsMapper.deleteDispatchEnergyConsumptionRecordsByEnergyConsumptionRecordsId(energyConsumptionRecordsId);
    }
}
